package com.huawang.mdesign.model.service.request;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.huawang.mdesign.model.service.request.propertymerge.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * @auther lairenmao
 * @date 2025/4/16
 * 预览值
 */
@Data
@SuperBuilder
@NoArgsConstructor
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "dataType",visible = true)
@JsonSubTypes({
        @JsonSubTypes.Type(value = IntegerPreviewValue.class, name = "Integer"),
        @JsonSubTypes.Type(value = StringPreviewValue.class, name = "String"),
        @JsonSubTypes.Type(value = StringPreviewValue.class, name = "UnlimitedNatural"),
        @JsonSubTypes.Type(value = LongPreviewValue.class, name = "Long"),
        @JsonSubTypes.Type(value = BooleanPreviewValue.class, name = "Boolean"),
        @JsonSubTypes.Type(value = InstancePreviewValue.class, name = "Instance"),
        @JsonSubTypes.Type(value = RealPreviewValue.class, name = "Real"),
})
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class PreviewValue implements Value{
    @Schema(title = "类型,存在string,boolean,real,instance,UnlimitedNatural等类型")
    private String dataType;

}
